package com.asiainfo.kbisheet.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.asiainfo.kbisheet.vo.SettingVO;

/**
 * BU的工厂类
 * 
 * @author kyunra
 * 
 */
public class BUFactory {
	protected static final Log log = LogFactory.getLog(BUFactory.class);
	private static BU bu;

	/**
	 * 创建BU对象
	 */
	public static BU createBU() {
		if (bu == null) {
			log.info("创建BU");
			SettingVO settingVO = Setting.getSettingVO();
			try {
				bu = (BU) Class.forName(settingVO.getBuClass()).newInstance();
			}
			catch (ClassNotFoundException e) {
				e.printStackTrace();
			}
			catch (InstantiationException e) {
				e.printStackTrace();
			}
			catch (IllegalAccessException e) {
				e.printStackTrace();
			}
		}
		return bu;
	}
}
